<template lang="">
    <div class="category">
        <h3>{{title}}分类</h3>
        <!-- 定义一个插槽(挖个坑，等着组件的使用者进行填充) -->
        <slot :games="games">我是一个默认值，当使用者没有传值时出现</slot>
    </div>
</template>
<script>
    export default {
        name:"Category",
        props:['title'],
        data(){
            return{
            games:["红色警戒","穿越火线","劲舞团","超级玛"],
            }
        }
    }
</script>
<style lang="less" scoped>
    .category{
        width: 200px;
        height: 300px;
        background-color: aqua;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    h3{
        text-align: center;
        background-color: orange;
    }
    img{
        width: 100%;
    }
</style>